<?php
// this is the standard template data
$templateData = array(
    'title' => $this->title,
    'resourceUri' => $this->resourceUri,
    'description' => $this->description,
    'descriptionHelper' => $this->descriptionHelper,
    'options'           => $this->options
);
?>
<?php if ($content = trim($this->partial( 'lod2/content.phtml', $templateData))): ?>

<div class="maincontent">
    <div class="section">
        <h3><?php echo $this->title ?></h3>
        <div class="section-content">
            <?php echo $content; ?>
        </div>
    </div>
</div>

<?php endif; ?>


<?php // PARTNERS

$query = '
PREFIX lod2: <http://lod2.eu/schema/>
PREFIX sysont: <http://ns.ontowiki.net/SysOnt/>
SELECT DISTINCT ?resourceUri
WHERE {
<'.$this->resourceUri.'> lod2:partner ?resourceUri.
?resourceUri a lod2:Partner.
?resourceUri sysont:order ?order.
FILTER (!isBLANK(?resourceUri))
}
ORDER BY ASC(?order)
​';

$partners = trim($this->querylist($query, 'lod2/items/li.phtml'));

?>

<?php // DELIVERABLES

$query = '
PREFIX lod2: <http://lod2.eu/schema/>
SELECT DISTINCT ?resourceUri
WHERE {
?resourceUri lod2:wp <'.$this->resourceUri.'> .
?resourceUri lod2:deliveryDate ?date.
?resourceUri a lod2:Deliverable.
FILTER (!isBLANK(?resourceUri))
}
ORDER BY ASC(?date)
​';

$deliverables = trim($this->querylist($query, 'lod2/items/li.phtml'));
?>

<?php // MILESTONES

$query = '
PREFIX lod2: <http://lod2.eu/schema/>
SELECT DISTINCT ?resourceUri
WHERE {
?resourceUri lod2:wp <'.$this->resourceUri.'> .
?resourceUri lod2:deadline ?date.
?resourceUri a lod2:Milestone.
FILTER (!isBLANK(?resourceUri))
}
ORDER BY ASC(?date)
​';

$milestones = trim($this->querylist($query, 'lod2/items/li.phtml'));
?>

<?php if ($partners || $deliverables || $milestones): ?>
<div class="subcolumns">

    <?php if ($partners): ?>

    <div class="c33l">
        <div class="subcl widget-deeplink">
            <h3>Partners</h3>
             <ul>
                <?php echo $partners ?>
             </ul>
        </div>
    </div>

    <?php endif; ?>

    <?php if ($deliverables): ?>

    <div class="c33l">
        <div class="subc widget-deeplink">
            <h3>Deliverables</h3>
             <ul>
                <?php echo $deliverables ?>
             </ul>
        </div>
    </div>

    <?php endif; ?>


    <?php if ($milestones): ?>

    <div class="c33l">
        <div class="subcr widget-deeplink">
            <h3>Milestones</h3>
             <ul>
                <?php echo $milestones ?>
             </ul>
        </div>
    </div>

    <?php endif; ?>

</div>
<?php endif; ?>